#pragma once
#include "Course.h"
#include "CourseException.h"

class Mathematics :
	public Course
{
private:
	char grade;
public:

	Mathematics()
	{
		grade = ' ';
	}

	Mathematics(string name, int year, char grade )
		: Course(name, year)
	{
		if (grade < 'A' || grade > 'F')
		{
			ostringstream oss;
			oss << "Invalid grade for object: " << name << ", " << year << ", " << grade << endl;
			throw CourseException(oss.str());
		}
		this->grade = grade;
	}

	~Mathematics()
	{
	}

	void setGrade(char grade){ this->grade = grade; }

	char getGrade(){ return this->grade; }

	void print()
	{
		Course::print();
		cout << ", Grade: " << grade;
	}
};

